<template>
  <el-dialog :title="title"
             :visible.sync="visible"
             custom-class="dialog"
             top="30vh"
             width="80%">
    <div v-if="this.type == 'uploadExcel'">
      <uploadExcel></uploadExcel>
    </div>
    <span slot="footer"
          class="dialog-footer">
      <el-button @click="this.closeHandler">取 消</el-button>
      <el-button type="primary"
                 @click="visible = false">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import uploadExcel from './UploadExcel'

export default {
  name: 'vue-dialog',
  created() {},
  mounted() {},
  components: {
    uploadExcel
  },
  props: {
    // 标题
    title: {
      String,
      default: '上传组件'
    },
    // 控件是否可见
    visible: {
      Boolean,
      default: false
    },
    // 组件类型
    type: {
      String,
      required: true,
      default: 'upload'
    }
  },
  watch: {
    visible(value) {
      console.debug('watch %s', value)
    }
  },
  data() {
    return {
      isVisable: false
    }
  },
  methods: {
    closeHandler() {
      this.isVisable = false
    }
  }
}
</script>

<style language="scss" scoped>
.dialog {
}
</style>
